package com.example.androidstart;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;

import com.example.androidstart.view.BiggerView;
import com.example.androidstart.view.CustomFrameLayout;

import java.io.IOException;

public class BiggerImageActivity extends AppCompatActivity {
    private static final String TAG = "BiggerImageActivity";

    private CustomFrameLayout customFrameLayout;

    private ImageView mImageVIew;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bigger_image);
        customFrameLayout = findViewById(R.id.view_root_container);
        mImageVIew = findViewById(R.id.index_point);
        BiggerView biggerView = findViewById(R.id.biggerView);
        customFrameLayout.setBiggerView(biggerView);
        customFrameLayout.setIndexPoint(mImageVIew);
        try {
            biggerView.setBitmap(BitmapFactory.decodeStream(BiggerImageActivity.this.getResources().getAssets().open("bg.jpg")));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}